package com.kaigejava.template.lifetemplate;

import lombok.Data;
import lombok.ToString;

/**
 * Created by kaigejava on 2019/9/5.
 */
@Data
@ToString
public class Duck implements  Comparable<Duck> {
    private String name = "";
    private int weight = 1;
    public Duck(String name,int weight){
        this.name = name;
        this.weight = weight;
    }
    @Override
    public int compareTo(Duck o) {
        if(this.weight>o.weight){
            return 1;
        }else if(this.weight == o.weight){
            return 0;
        }
        return -1;
    }
}
